Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal changes to produce passing travis build #142

Merged
merged 27 commits into from Jun 15, 2019
Merged

Minimal changes to produce passing travis build #142

merged 27 commits into from Jun 15, 2019

Conversation

djnavarro
Copy link
Collaborator

This aim here is to allow the ggplot2 book to build cleanly on travis. It still uses oldbookdown and makes almost no changes to any R code shown in the book (the only exceptions being those caused by changes to the USAboundaries and scales packages since publication of the 2nd edition).

changes that alter the code (or output) shown to reader

  • The back transformation example in position.rmd produces several pages of warnings about NaN values. These are now suppressed in the knitr chunk on line 446

  • In scales.Rmd there are a couple of cases where the interface to scales::unit_format() etc has changed, so the arguments to scales::unit_format() and scales::dollar_format() are now named explicitly (I think the dollar one may be unnecessary)

  • palette names in the wesanderson package have changes since second edition to the book. These are all updated now (e.g. Zissou is now Zissou1).

  • The USAboundaries package has changed in two respects since ggplot2 2nd ed: it now generates an sf object, and the underlying data is in the USAboundariesData package on ropensci. Lines 685-687 of toolbox.rmd make minimal changes to the R code in the book.

changes that manage dependencies etc

  • The DESCRIPTION file lists new package dependencies (mostly linked to the dependency on the sf package), and travis.yml includes lines for sources, repos and packages needed to build sf on travis.

  • The existing source produces odd method dispatch for select. Rather than edit the code in the book, I've used conflicted::conflict_prefer() to manage this in the common.R script, explicitly preferring dplyr::select(). (Ditto for tidyr::extract())

  • In the render-tex.R file, I've added a dummy version of the tex_chapter() function that mirrors oldbookdown::tex_chapter() but now uses "--top-level-division=chapter" as an argument to pandoc. (Presumably this will be irrelevant when moving to new bookdown)

  • In ggplot2-book.tex, I've defined commands for OperatorTok and ControlFlowTok. The inserted commands don't do anything, but the .tex files generated by current version of pandoc now include those

  • The common.R script now calls tools::file_path_sans_ext() in place of the (now deleted) internal knitr:::sans_ext() function.

miscellaneous

  • for no particularly good reason the repository is reset to the "clean" state so the generated tex files for each chapter are deleted.

  • travis log for the current build: https://travis-ci.org/djnavarro/ggplot2-book/jobs/545943102

  • I'm still learning the etiquette of making a PR. My apologies in advance if something is awry!

  • just in case :-) "I assign the copyright of this contribution to Hadley Wickham"

djnavarro and others added 27 commits June 14, 2019 13:52
@hadley hadley merged commit 9fc7a34 into hadley:master Jun 15, 2019
@hadley
Copy link
Owner

hadley commented Jun 15, 2019

Awesome, thanks @djnavarro!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants